|
|
|
|
|
|
|
The RSDelete routine performs a delete operation on the selected data record. But before committing the deed, the user is given a chance to reverse the process. Add Listing 10.15 to the library. |
|
|
|
|
|
|
|
|
Listing 10.15. Coding the RSDelete function. |
|
|
|
|
|
|
|
|
Private Function RSDelete()
'
' delete current record
'
Dim lngResult As Long
'
lngResult = MsgBox("Delete current record?", vbYesNo + vbQuestion, rs.Name)
If lngResult = vbYes Then
rs.Delete
End If
'
RSDelete = 0
Exit Function
'
LocalErr:
RSDelete = Err.Number
'
End Function |
|
|
|
|
|
|
|
|
You need three more routines to complete the record-handling portion of the library. RSClose handles the final closing of the record-handling routines; RSBack and RSNext provide a safe way to process Visual Basic MovePrevious and MoveNext operations without encountering end-of-file errors from Visual Basic. Add these three routines, which are provided in Listing 10.16, to the library. |
|
|
|
|
|
|
|
|
Listing 10.16. Coding the RSClose, RSBack, and RSNext routines. |
|
|
|
|
|
|
|
|
Public Sub RSClose()
'
' close down object
'
Class_Terminate
'
End Sub |
|
|
|
|
|